/*
 *@author: YangJie
 *@date: 2021-04-07 16:48:13
 *@version:
 *@description:维修保养=>故障报修
 */
import React, { Component } from 'react';
import { Table, Button, Form, Card, Tabs ,Input ,Drawer, TreeSelect ,DatePicker,Select,Switch,Row,Col,message,Upload,Icon ,Modal ,Radio,Checkbox} from 'antd';
import '@/assets/css/settings';
import * as Utils from '../../utils_yyr/action';
import BasicForm from '../../components_yyr/common/basicForm';
import { FileDown } from '../../components_yyr/commponent/File';
import Paging from '../../components_yyr/commponent/Paging';
import BasicConfirm from '../../components_yyr/common/basicConfirm';
import { euqApplicationName, lotAuth, lotAuth2 } from '../../config';
import {baseUrl} from '../../config';
import moment from 'moment';
import 'moment/locale/zh-cn';
import Zmage from 'react-zmage'
moment.locale('zh-cn')

const nowDate = Utils.getNowDate()
const { TabPane } = Tabs;
const {TreeNode} = TreeSelect
const {Option} = Select
const { TextArea } = Input

const mainFactoryList = {
	//所在部门
	doorMinimumPrice: [
		{ value: '维护分布', title: '维护分布', },
		{ value: '头孢固体一车间 ', title: '头孢固体一车间 ' },
		{ value: '资源管理部 ', title: '资源管理部 ', children: [{ value: '维护分布', title: '维护分布' },] }],
	//设备类别
	sblb: [
		{ value: 'wqw', title: 'wqw', children: [{ value: 'wdwd', title: 'wdwd' },] },
		{ value: 'dwdw ', title: 'dwdw ' },
		{ value: '模温机 ', title: '模温机 ', children: [{ value: '温控卡', title: '温控卡' },] },
		{ value: '锅炉 ', title: '锅炉 ' },],
	//故障类别
	gzlb: [
		{ value: '机械故障', title: '机械故障', children: [{ value: '部件磨损', title: '部件磨损' }, { value: '锈蚀卡死', title: '锈蚀卡死' }, { value: '密封泄露', title: '密封泄露' }] },
		{ value: '电气故障 ', title: '电气故障 ', children: [{ value: '能量供给故障', title: '能量供给故障' }, { value: '其它故障', title: '其它故障' }] },
		{ value: '物料原因故障 ', title: '物料原因故障 ', children: [{ value: '仓库物料数量不足', title: '仓库物料数量不足' }, { value: '备件购置困难', title: '备件购置困难' }] }],

	// 故障等级 
	gzlevel: [{ id: 1, value: '大故障' }],
	// 维修组
	wxGroup: [{ id: 1, value: '维修班组' }, { id: 2, value: '系统评估班组' }],
	// 紧急程度
	harborOneHundredPrice: [{ id: 1, value: '紧急' }, { id: 2, value: '高' }, { id: 3, value: '低' }],
};
class App extends Component {
	state = {
		loading: false, //加载中...
		loading_cz: false, //加载中...
		dataSource: [], //数据源
		dataSource1: [],
		drawerVisible: false, //新增修改抽屉的显示与隐藏
		chooseData: {},
		drawerTitle: '',
		total: 0,
		formValues: {},
		cityData: [],
		mainFactoryList: mainFactoryList,
		selectedData: [],
		selectedKeys: [],
		handleType:0,
		EquTypePageList:[],
		gzdj:[],//故障等级列表,
		gzlb:[],//故障类型列表,
		DepartmentList:[],//部门列表
		UserList:[],//用户查询
		jjcd:[],//紧急程度列表
		wxz:[],
		visibleEqu :false,
		loadingTable: false,
		tableData: [],
		totalTable:0,
		formValuesTable:{},
		selectedDataTable: [],
		status:0,
		selectedKeysTable: [],
		value:1,
		fileList:[],
		pictureIdList:[],
		ChoosePicList:[],
		pictureIds:[],
		FaultOperationRecordList:[],
		roleList:[]
	};
	componentDidMount() {
		this.fetch({
			pageNum: 1,
			pageSize: 10,
			typeIds:0,
			typeIds1:1,
			userId:localStorage.getItem('userId'),
			isApp:0
		});
		this.gzdj();
		this.gzlb();
		this.EquTypePageList()
		this.queryTreeDepartment()
		this.queryPageUser()
		this.jjcd()
		this.wxz()
		this.roleList()
	}
	//初始化加载数据
	fetch = (data) => {
		let str = ''
		for(var key in data){
			if(key=='typeIds1'){
				str += `&typeIds=${data[key]}`
			}else
			if(data[key]||data[key]===0){
				str += `&${key}=${data[key]}`
			}
		}
		this.setState({ loading: true })
		this.get(euqApplicationName + '/equipmentRepairFault/findEquipmentRepairFaultList?'+str).then(res => {
			this.setState({
				loading: false,
				dataSource: res.data.data,
				total:res.data.total,
				formValues:data,
				fileList:[],
				selectedKeys:[],
				selectedData:[]
			});
			this.getPicPath(res.data.data)
		})
		
	};
	getPicPath = (data) => {
		for(var record of data){
			record.picPath = []
			if(record.pictureIdList && record.pictureIdList.length>0){
				for(var item of record.pictureIdList){
					this.get(`/lot-file/file/queryFileId/${item}`).then(res=>{
						record.picPath.push(res.data)
					})
				}
			}
		}
		this.setState({dataSource:data})
		console.log(data)
	}
	// 下一审核人
	roleList = () => {
		this.get(euqApplicationName + '/parameter_setting_system/findRoleList').then(res1 => {
			this.setState({
				roleList : res1.data
			});
		})
	}
	//   用户查询
	queryPageUser = () => {
		this.get(lotAuth2 + '/user/queryPageUser').then(res => {
			this.setState({
				UserList : res.data.data
			});
		})
	}
	// 部门查询
	
	queryTreeDepartment = () => {
		// this.get(lotAuth + '/department/queryTreeDepartment').then(res => {
			this.get(lotAuth2 + '/department/queryTreeDepartment').then(res => {
			this.setState({
				DepartmentList : res.data
			});
		})
	}

	EquTypePageList = () => {
		this.get(euqApplicationName + '/parameter_setting_equipmentType/findEquTypePageList').then(res1 => {
			this.setState({
				EquTypePageList : res1.data
			});
		})
	}
	wxz = () => {//维修组
	   this.get(euqApplicationName + '/parameter_setting_public/queryTeamPageList?type=维修').then(res => {
	   this.setState({
			wxz: res.data,
		});
		})
   }; 
	gzdj = () => {//故障等级列表
	   this.get(euqApplicationName + '/api/findEquipmentNextParameterPageList?typeId=3').then(res => {
	   this.setState({
			gzdj: res.data,
		});
		})
   }; 
   jjcd = () => {//紧急程度列表
	  this.get(euqApplicationName + '/api/findEquipmentNextParameterPageList?typeId=8').then(res => {
	  this.setState({
		jjcd: res.data,
	   });
	   })
  }; 
   gzlb = () => {//故障类型列表
	  this.get(euqApplicationName + '/api/findEquFaultTypePageList').then(res => {
	  this.setState({
		gzlb: res.data,
	   });
	   })
  }; 
	getInfo = () => {
		this.post('/carrierPrice/mainFactoryList').then(res => this.setState({ mainFactoryList: res.data })); //主机厂
	};

	// 表格删除
	handleConfirm = (value, api, chooseData) => {
		console.log(this.state.selectedData)
		let str = ''
		for(var item of this.state.selectedData){
			str += item.iid + ','
		}
		this.get(`${euqApplicationName}/equipmentRepairFault/deleteEquipmentRepairFaultList?ids=${str.slice(0, str.length - 1)}`).then(res => {
			this.success();
			this.fetch({ ...this.state.formValues });
			this.setState({selectedKeys:[],selectedData:[]})
		});
	};

	handleDelete = () => {
		const {ChoosePicList,pictureIds,chooseData} = this.state
		let newData = []
		pictureIds.forEach(item => {
			ChoosePicList.indexOf(item) === -1 && newData.push(item);
		});
		console.log(newData)
		let str = ''
		for(var item of newData){
			str += item + ','
		}
		this.get(`${euqApplicationName}/equipmentRepairFault/deleteImgPathList?ids=${str.slice(0, str.length - 1)}&id=${chooseData.informationId}`).then(res => {
			this.success();
			this.fetch({ ...this.state.formValues });
			this.setState({selectedKeys:[],selectedData:[],ChoosePicList:[],pictureIds:[],pictureIdList:[]})
		});
	}
	// 表格打印
	handlePrinting = (type, data) => {
		console.log("打印=====")
	}

	formList = () => {
		const formList = [
			{ type: "INPUT", label: "单号", field: "orderCode", },
			{
				type: 'SELECT', label: '处理状态', field: 'statusIds', name: 'value',
				// 处理状态1.待审核 2.审核中 3.待维修 4.维修中 5.待验证 6.已完成
				list: [{ id: 1, value: '待审核' }, { id: 2, value: '审核中' }, { id: 3, value: '待维修' }, { id: 4, value: '维修中' }, { id: 5, value: '列入计划' }, { id:8, value: '已完成' }, { id: 7, value: '驳回' }],
				valueField: 'id'
			},
			{
				type: 'SELECT', label: '报修人', field: 'operator',  name: 'userName', valueField: 'userName', list: this.state.UserList ,
			},
			// {
			// 	type: 'SELECT', label: '相关性', field: 'route', name: 'value',
			// 	list: [{ id: 1, value: '我报修' }, { id: 2, value: '待我审核' }],
			// 	valueField: 'value'
			// }
		];
		return formList;
	};
	
	formListModal = () => {
		const {  EquTypePageList, DepartmentList } = this.state;
		const formList = [
			{ type: 'TREESELECT', label: '设备类别', field: 'equType',  name: 'name', valueField: 'id', list:EquTypePageList,allowClear:true},
			{ type: "TREESELECT", label: "所在部门", field: "deptId", name: 'name', valueField: 'id', list: DepartmentList},
		];
		return formList;
	};

	//表单查询
	filterSubmit = values => {
		console.log("表单查询=====", values)

		values.pageNum = this.state.formValues.pageNum;
		values.pageSize = this.state.formValues.pageSize;
		values.userId = localStorage.getItem('userId');
		values.typeIds = 0;
		values.typeIds1 = 1;
		values.isApp = 0;
		this.fetch(values);
	};
	drawerFormList = data => {
		const { mainFactoryList , EquTypePageList ,gzdj ,gzlb , DepartmentList ,UserList, jjcd} = this.state;
		const drawerFormList = [
			{ type: 'TITLE', label: '设备信息' },
			{ type: "INPUT", label: "设备编号", field: "equCode", initialValue: data.equCode},
			{ type: "INPUT", label: "设备名称", field: "equName", initialValue: data.equName, required: true },
			{ type: 'TREESELECT', label: '设备类别', field: 'equType', initialValue: data.equType, name: 'name', valueField: 'id', list:EquTypePageList,allowClear:true},
			{ type: "INPUT", label: "规格型号", field: "equSpecsModel", initialValue: data.equSpecsModel },
			{ type: "TREESELECT", label: "所在部门", field: "deptId", initialValue: data.deptId, name: 'name', valueField: 'id', list: DepartmentList},
			{ type: "INPUT", label: "设备位置", field: "equLocation", initialValue: data.equLocation },
			{ type: "BUTTON", label: "选择设备", modalType:'TABLE',ModalProps:{
				
			}},

			{ type: 'TITLE', label: '处理情况' },
			{ type: "DATE", label: "发生时间", field: "dateSec_occurrenceTime", initialValue: data.occurrenceTime ? data.occurrenceTime : nowDate, required: true ,showTime:true },
			{ type: "INPUT", label: "操作人", field: "operator", initialValue: data.operator },
			{ type: "INPUT", label: "操作者电话", field: "operatorTel", initialValue: data.operatorTel },
			{ type: "SELECT", label: "故障等级", field: "faultLevel", initialValue: data.faultLevel, name: 'configValue', valueField: 'id', list: gzdj },
			{ type: "TREESELECT", label: "故障类别", field: "faultTypeId", initialValue: data.faultTypeId, name: 'name', valueField: 'id', list: gzlb ,allowClear:true },
			{ type: "SELECT", label: "维修组", field: "maintainTeamId", initialValue: data.maintainTeamId, name: 'value', valueField: 'id', list: mainFactoryList.wxGroup },
			{ type: "SELECT", label: "紧急程度", field: "urgency", initialValue: data.urgency, name: 'configValue', valueField: 'id', list: jjcd},
			{ type: "RADIO", label: "是否停机", field: "isStop", initialValue: data.isStop ,
			list: [{ id: 1, name: '停机' },{ id: 0, name: '不停机' , checked : true }],name: 'name', valueField: 'id',},
			// { type: "INPUT", label: "经验代码", field: "uniqueAddress", initialValue: data.uniqueAddress, list: mainFactoryList },
			{ type: "SELECT", label: "下一审核人", field: "lastOperate", initialValue: data.lastOperate, name: 'userName', valueField: 'userId', list: UserList ,required:true },
			{ type: "TEXTAREA", label: "故障描述", field: "faultDescription", initialValue: data.faultDescription, required: true },
			// { type: "BOTTOM", label: "经验库", field: "harborMinimumPrice", initialValue: data.harborMinimumPrice },

		];
		let obj = { type: "FILEUPLOAD", label: "图片上传", field: "upload_pictureId" ,apiPath:'/lot-file/file/uploadFile' ,buttonName:'上传图片' , fileId :true}
		if(this.state.handleType === 0){
			drawerFormList.push(obj)
		}
		return drawerFormList;
	};

	lastOperateIsChoose = () => {
		const p = this
		this.props.form.validateFields(['lastOperate'],(err,values)=>{
			if(!err){
				if(values['lastOperate']){
					if(this.state.handleType!==2){
						p.handleSubmit()
					}else if(this.state.handleType===2){
						p.handleSubmitApply()
					}
				}else if(this.state.handleType!==2){
					Modal.confirm({
						title: '提示',
						content: '你没有选择下一审核人？',
						onOk() {
							p.handleSubmit()
						},
						onCancel() {
						    console.log('Cancel');
						},
						okText:"确认",
         				cancelText:"取消"
					  });
				}else if(this.state.handleType===2){
					Modal.confirm({
						title: '提示',
						content: '你没有选择下一审核人，是否结束审核？',
						onOk() {
							p.handleSubmitApply()
						},
						onCancel() {
						    console.log('Cancel');
						},
						okText:"确认",
         				cancelText:"取消"
					  });
				}
			}
		})
	}

	// 提交modal
	handleSubmitApply = () => {
		const { dataSource, chooseData , selectedDataTable} = this.state;
		const p = this;
		let UserList = this.state.UserList
		const { form } = this.props;
		const apply = ['operateId','maintainTeamId','checkReview','repairWorker','planExeTime','dealReview','lastOperate']
		form.validateFieldsAndScroll(apply,(err, fieldsValue) => {
			if (err) {
				return;
			}
			console.log(fieldsValue)
			for (var key in fieldsValue) {
				//单个时间选择器--需要时分秒
				if (key === 'planExeTime') {
					if (fieldsValue[key]) {
						fieldsValue[key] = Utils.getDate(fieldsValue[key]);
					}
				}
			}
			const id = this.state.chooseData && this.state.chooseData.id;
			fieldsValue.repairInfoId = id;
			fieldsValue.userId = localStorage.getItem('userId');
			fieldsValue.operateId = localStorage.getItem('userId');
			fieldsValue.informationId = chooseData.informationId
			if(fieldsValue.repairWorker){
				if(fieldsValue.repairWorker.length>0){
					console.log(fieldsValue.repairWorker)
					let equipmentRepairWorkAddDTOList = []
					fieldsValue.repairWorker.forEach(item=>{
						for(var items of UserList){
							if(item == items.userId){
								equipmentRepairWorkAddDTOList.push({
									personId:items.userId,
									personName:items.userName
								})
							}
						}
					})
					console.log(equipmentRepairWorkAddDTOList)
					for(let ii in equipmentRepairWorkAddDTOList){
						if(ii==0){
							equipmentRepairWorkAddDTOList[ii].perType = 0
						}else{
							equipmentRepairWorkAddDTOList[ii].perType = 1
						}
					}
					console.log(equipmentRepairWorkAddDTOList)
					fieldsValue.equipmentRepairWorkAddDTOList = equipmentRepairWorkAddDTOList
					fieldsValue.repairWorker = fieldsValue.repairWorker.length>0 ? fieldsValue.repairWorker.join(',') : fieldsValue.repairWorker[0]
				}else{
					fieldsValue.repairWorker = ''
				}
			}
			console.log(fieldsValue)
			this.post(euqApplicationName + '/equipmentRepairFault/failureReportAudit', { data : fieldsValue }).then(res => {
				this.success();
				this.fetch({ ...this.state.formValues });
				this.onClose();
			});
			});
		
	};
	// 提交modal
	handleSubmit = () => {
		const { dataSource, chooseData , selectedDataTable} = this.state;
		const p = this;
		const { form } = this.props;
		form.validateFieldsAndScroll(['equCode','equName','equType','equSpecsModel','deptId','equLocation','dateSec_occurrenceTime','operator','operatorTel','faultLevel','faultTypeId','maintainTeamId','urgency','isStop','lastOperate','faultDescription',],(err, fieldsValue) => {
			if (err) {
				return;
			}
			console.log(fieldsValue)
			for (var key in fieldsValue) {
				//单个时间选择器--需要时分秒
				if (key.indexOf('dateSec_') === 0) {
					if (fieldsValue[key]) {
						let arr = key.split('_');
						fieldsValue[arr[1]] = Utils.getDateHHMMYY_HHMMSS(fieldsValue[key]);
					}
					delete fieldsValue[key];
				}
			}
			// if(this.state.fileId){
			// 	fieldsValue.pictureId = this.state.fileId
			// }
			const res = this.state.fileList
			let str = this.state.chooseData.pictureId ? this.state.chooseData.pictureId : ''
			for(var item of res){
				str += item.id + ','
			}
			fieldsValue.isStop = fieldsValue.isStop ? 1 : 0
			fieldsValue.pictureId = str.slice(0, str.length - 1)
			fieldsValue.equId = selectedDataTable.length===1 ? selectedDataTable[0].id : chooseData.equId
			fieldsValue.equType = selectedDataTable.length===1 ? selectedDataTable[0].equTypeId : null
			fieldsValue.deptId = selectedDataTable.length===1 ? selectedDataTable[0].depId : null
			const id = this.state.chooseData && this.state.chooseData.informationId;
			if (id && this.state.handleType===1) {
				fieldsValue.id = id;
				fieldsValue.userId = localStorage.getItem('userId');
			} else {
				fieldsValue.userId = localStorage.getItem('userId');
			}
			console.log(fieldsValue)
			this.post(euqApplicationName + '/equipmentRepairFault/saveEquipmentRepairFaultList', { data : fieldsValue }).then(res => {
				this.success();
				this.fetch({ ...this.state.formValues });
				this.onClose();
			});
			});
		
	};

	// 打开modal，判断是修改还是新增 0新增 1修改
	handleModal = (type, data) => {
		if (type===1) {
			// 'faultDescription','isStop''urgency''maintainTeamId''faultTypeId''faultLevel''operatorTel''operator','dateSec_occurrenceTime','equCode', 'equName','equType','equSpecsModel','deptId','equLocation''lastOperate',
			const arr = [ 'faultDescription','isStop','urgency','maintainTeamId','faultTypeId','faultLevel','operatorTel','operator','dateSec_occurrenceTime','equCode', 'equName','equType','equSpecsModel','deptId','lastOperate','equLocation']
			let obj = {}
			for(var item of arr){
				if(item==='dateSec_occurrenceTime'){
					if(data['occurrenceTime']){
						obj['dateSec_occurrenceTime'] = moment(data['occurrenceTime']) 
					}
				}else if(item==='isStop'){
					obj[`isStop`] = data[`isStop`] ? true : false	
				}else if(item==='deptId'){
					obj[`${item}`] = data[`equipmentDepart`]
				}else if(item==='operatorTel'){
					obj[`${item}`] = data[`operatorTel`] ? data[`operatorTel`] : localStorage.getItem('phone')
				}else if(item==='operator'){
					obj[`${item}`] =  data[`operator`] ? data[`operator`] : localStorage.getItem('userName')
				}else {
					if(data[`${item}`]){
						obj[`${item}`] = data[`${item}`]
					}
				}
			}
			setTimeout(() => {
				this.props.form.setFieldsValue(obj)
			}, 50);
			this.setState({
				drawerTitle: data.status === 1 || data.status === 2 ? '修改' : '详情',
				drawerVisible: true,
				chooseData: data,
				handleType:type,
				status:data.status
			});
		} else if(type===0){
			let obj = {
				operator:localStorage.getItem('userName'),
				operatorTel:localStorage.getItem('phone')
			}
			setTimeout(() => {
				this.props.form.setFieldsValue(obj)
			}, 50);
			this.setState({
				drawerTitle: '新增',
				drawerVisible: true,
				chooseData: data,
				handleType:type,
				status:data.status
			});
		} else if (type===2) {
			// 'operateId''maintainTeamId''checkReview','repairWorker','planExeTime','dealReview' -----审核
			const arr = [ 'faultDescription','isStop','urgency','maintainTeamId','faultTypeId','faultLevel','operatorTel','operator','dateSec_occurrenceTime','equCode', 'equName','equType','equSpecsModel','deptId','equLocation',]
			const apply = ['operateId','maintainTeamId','checkReview','repairWorker','planExeTime','dealReview']
			let obj = {
				'operateId' : data['username'],
				'maintainTeamId' : data['maintainTeamId'],
			}
			if(data['maintainTeamId']){
				let wxz = this.state.wxz
				wxz.forEach((item)=>{
					return item.id == data['maintainTeamId'] && this.setState({UserList:item.userIdList})
				})

			}
			for(var item of arr){
				if(item==='dateSec_occurrenceTime'){
					if(data['occurrenceTime']){
						obj['dateSec_occurrenceTime'] = moment(data['occurrenceTime']) 
					}
				}else if(item==='isStop'){
					obj[`isStop`] = data[`isStop`] ? true : false	
				}else if(item==='deptId'){
					obj[`${item}`] = data[`equipmentDepart`]
				}else if(item==='operatorTel'){
					obj[`${item}`] = data[`operatorTel`] ? data[`operatorTel`] : localStorage.getItem('phone')
				}else if(item==='operator'){
					obj[`${item}`] =  data[`operator`] ? data[`operator`] : localStorage.getItem('userName')
				}else {
					if(data[`${item}`]){
						obj[`${item}`] = data[`${item}`]
					}
				}
			}
			setTimeout(() => {
				this.props.form.setFieldsValue(obj)
			}, 50);
			this.setState({
				drawerTitle: '审核',
				drawerVisible: true,
				chooseData: data,
				handleType:type,
				status:data.status
			});
		} 
	};

	onClose = () => {
		this.setState({
			drawerVisible: false,
			chooseData: {},
			status:0
		});
		this.props.form.resetFields();
	};
	onTreeChange = () => { };

	renderTreeNodes = (data, name, valueField) =>
	// console.log(data, name, valueField)
		data && data.map(item => {
			if (item.children) {
				return (
					<TreeNode title={item[name]} key={item[valueField]} value={item[valueField]} dataRef={item}>
						{this.renderTreeNodes(item.children, name, valueField)}
					</TreeNode>
				);
			}
			return <TreeNode key={item[valueField]} value={item[valueField]} title={item[name]} {...item} />;
		});

	chooseEqu = () => {
		this.fetchTable({
			pageNum: 1,
			pageSize: 10
		})
		this.setState({visibleEqu : true})
	}

	fetchTable = (data) => {
		let str = ''
		for(var key in data){
			if(data[key]){
				str += `&${key}=${data[key]}`
			}
		}
		this.setState({ loadingTable: true })
		this.get(euqApplicationName + '/equipmentInfo/findEquInfoList?'+str).then(res => {
			this.setState({
				loadingTable: false,
				tableData: res.data.data,
				totalTable:res.data.total,
				formValuesTable:data,
				selectedKeysTable:[],
				selectedDataTable:[],
			});
		})
	}

	closeModal = () => {
		if(this.state.selectedKeysTable.length===0){
			this.props.form.resetFields(['equCode','equName','equType','equSpecsModel','deptId','equLocation'])
		}
		this.setState({visibleEqu:false})
	}

	modalSubmit = () => {
		if(this.state.selectedKeysTable.length!==1){
			Utils.openNotification('warning','请（仅）选择一条数据！')
			return;
		}
		let data = this.state.selectedDataTable[0]
		// 'equCode', 'equName','equType','equSpecsModel','deptId','equLocation'
		this.props.form.setFieldsValue({
			equCode : data.equCode,
			equName : data.equName,
			equType : data.equTypeName,
			equSpecsModel : data.equSpecsModel,
			deptId : data.userDepartmentName,
			equLocation : data.equipmentLocation,
		})
		this.closeModal()
	}
	TableSearch = () => {
		this.props.form.validateFields(['depId','equTypeId'],(err,values)=>{
			if(!err){
				console.log(values)
				values.pageNum = this.state.formValuesTable.pageNum;
				values.pageSize = this.state.formValuesTable.pageSize;
				this.fetchTable(values);
			}
		})
	}
	teamChange = (event) => {
		console.log(event)
		this.props.form.resetFields('repairWorker')
		if(event==undefined){
			this.queryPageUser()
			return
		}else{
			this.props.form.resetFields('repairWorker')
			const {wxz} = this.state
			wxz.forEach((item)=>{
				return item.id == event && this.setState({UserList:item.userIdList})
			})
		}

	}
	onChangeRadio = e => {
		// console.log('radio checked', e.target.value);
		let value = e.target.value
		this.setState({
		  value,
		});
	  };
	removeFile = (i) =>{
		console.log(i)
		let fileList = this.state.fileList
			 fileList.splice(i,1)
		console.log(fileList)
		this.setState({
			fileList
		})
	}
	onRowClick = (record) => {
		this.setState({loading_cz:true})
		if(record.imgPath && record.imgPath.length>0){
			this.setState({pictureIdList:record.imgPath,pictureIds:record.pictureIdList})
		}else{
			this.setState({pictureIdList:[],pictureIds:[]})
		}
		this.setState({selectedKeys:[record.id],ChoosePicList:[],chooseData:record,selectedData:[record]})
		// let arr = []
		// if(record.pictureIdList && record.pictureIdList.length>0){
		// 	for(var item of record.pictureIdList){
		this.get(`${euqApplicationName}/equipmentRepairFault/findEquipmentRepairFaultOperationRecordList?id=${record.iid}`).then(res=>{
			this.setState({FaultOperationRecordList:res.data,loading_cz:false})
		})
		// 	}
		// }
		// console.log(this.state.pictureIdList)
	}
	onChange = (values) => {
		console.log(values)
		this.setState({ChoosePicList:values})
	}
	handleUpload = (fileList) => {
		const {ChoosePicList,chooseData} = this.state
		console.log(chooseData)
		let pictureIds = this.state.pictureIds
		let arr = []
		arr = fileList.map(item => item.id)
		console.log(arr,'111')
		arr.forEach(item => {
			pictureIds.indexOf(item) === -1 && pictureIds.push(item);
		});
		console.log(pictureIds,'222')
		let str = ''
		for(var item of pictureIds){
			str += item + ','
		}
		this.get(`${euqApplicationName}/equipmentRepairFault/deleteImgPathList?ids=${str.slice(0, str.length - 1)}&id=${chooseData.informationId}`).then(res => {
			this.success();
			this.fetch({ ...this.state.formValues });
			this.setState({selectedKeys:[],selectedData:[],ChoosePicList:[],pictureIds:[],pictureIdList:[]})
		});
	}
	disabledDate = (current) => {
		return current > moment().endOf('day');
	}
	render() {
		const columns = [
			{
				title: '详细', width: 80, 
				render: (text, record) => {
					return <span><a href onClick={() => this.handleModal(1, record)}>详细</a></span>
				}
			},
			{
				title: '审核', width: 80, 
				render: (text,record) => {return  (record.status === 1 && (record['lastOperate'] == localStorage.getItem('userId') )) || (record.status === 1 && !record.lastOperate ) || ((record['lastOperate'] == localStorage.getItem('userId')) && ( record.status === 2))?<span><a onClick={()=>this.handleModal(2,record)}>审核</a></span> : ''}
				
			},
			{ title: '单号', width: 150, dataIndex: 'orderCode' },
			{ title: '处理状态', width: 150, dataIndex: 'status',
				render:(text,record)=>{
					if( text===3 || text===9 ){
						return '待维修'
					}else if(text===10){
						return '维修中'
					}
					else{
						return text === 1 ? '待审核' : text === 5 ? '列入计划' : text === 2 ? '审核中' : text === 7 ? '驳回' :text===4 ? '维修中': text===8 ? '已完成' : ''
						// return text===1 ? '待审核' : text===2 ? '审核中' : text===4 ? '维修中' : text===5 ? '列入计划' : text===6 ? '待验证' : text===7 ? '驳回' : text===8 ? '已完成' : text===10 ? '暂停中' : ''
					}
				}
			},
			// { title: '处理状态', width: 100, dataIndex: 'status' ,render:(text)=>{
			// 	return text === 1 ? '待审核' : text === 2 ? '审核中' : text === 3 ? '待维修' : text === 4 ? '维修中' : text === 5 ? '列入计划' :  text === 6 ? '待验证' :  text === 7 ? '驳回' :  text === 9 ? '待执行' : text === 8 ? '已完成' : text === 10 ? '暂停中' : ''
			// }},
			{ title: '设备名称', width: 150, dataIndex: 'equName' },
			{ title: '使用部门', width: 150, dataIndex: 'equipmentDepart' },
			{ title: '报修人', width: 150, dataIndex: 'operator' },
			{ title: '报修时间', width: 200, dataIndex: 'occurrenceTime' },
			{ title: '故障描述', width: 150, dataIndex: 'faultDescription' },
			{
				title: '维修单号', width: 150, dataIndex: 'equRepairCode',
				// render: (text) => (<span>	<a onClick={this.handleDetail}>{text}</a>	</span>)
			},
			{ title: '规格型号', width: 150, dataIndex: 'equSpecsModel' },
			{ title: '维修组', width: 150, dataIndex: 'maintainTeamName' },
		];

		const columns1 = [
			{ title: '处理时间', width: 150, dataIndex: 'processingTime' },
			{ title: '操作用户', width: 150, dataIndex: 'operationUserName' },
			{ title: '操作', width: 150, dataIndex: 'operationTypeId',render:(text)=>{
				return text === 1 ? '添加' : text === 2 ? '审核' : ''} },
			{ title: '操作结果', width: 150, dataIndex: 'operationResult' },
		]
		const column = [
			{ title: '设备编码', width: 150, dataIndex: 'equCode' },
			{ title: '设备名称', width: 150, dataIndex: 'equName' },
			{ title: '规格型号', width: 150, dataIndex: 'equSpecsModel' },
			{ title: '使用部门', width: 150, dataIndex: 'userDepartmentName' },
			{ title: '设备类别', width: 150, dataIndex: 'equTypeName' },
			{ title: '设备位置', width: 150, dataIndex: 'equipmentLocation' },
		]

		const { chooseData, drawerVisible, drawerTitle, dataSource, dataSource1, loading, total, formValues, selectedData, selectedKeys ,visibleEqu ,totalTable ,formValuesTable ,loadingTable ,selectedKeysTable,ChoosePicList,pictureIds,FaultOperationRecordList,loading_cz} = this.state;
		const { mainFactoryList , EquTypePageList ,gzdj ,gzlb , DepartmentList ,UserList, jjcd ,wxz,roleList} = this.state;

		const drawerProps = {
			// onRef: ref => (this.modalRef = ref),
			visible: drawerVisible,
			width: 1000,
			// drawerFormList: this.drawerFormList(chooseData),
			submit: this.lastOperateIsChoose,
			onClose: this.onClose,
			title: drawerTitle,
		};

		//选择框
		const rowSelection = {
			selectedRowKeys: selectedKeys,
			onChange: (selectedRowKeys, selectedRows) => {
				this.setState({
					selectedData: selectedRows,
					selectedKeys: selectedRowKeys
				})
			},
			getCheckboxProps: record => ({
				disabled: record.name === 'Disabled User',
				name: record.name
			})
		};

		const rowSelectionTable = {
			selectedRowKeys: selectedKeysTable,
			onChange: (selectedRowKeys, selectedRows) => {
				this.setState({
					selectedDataTable: selectedRows,
					selectedKeysTable: selectedRowKeys
				})
			},
		}
		const { getFieldDecorator}=this.props.form
		const that = this
		const paramDataFile = {'userId':parseInt(localStorage.getItem('userId'))}
		const p = this
		const props = {
			action:baseUrl+'/lot-file/file/uploadFile',
			data:paramDataFile, 
			name: 'file',
			// accept:'.pdf',
			showUploadList:false,
			headers: {
				Token: localStorage.getItem('token'),
			},
			multiple:true,
			onChange(info) {
				if (info.file.status !== 'uploading') {
					// console.log(info.file, info.fileList);
				}
				if (info.file.status === 'done') {
					console.log(info.file.response.data)
					
					const fileList = that.state.fileList
					fileList.push(info.file.response.data)
					console.log(fileList)
					// }
					that.setState({
						fileList,
					}) 
					message.success(`${info.file.name} 上传成功`);
				} else if (info.file.status === 'error') {
					message.error(`${info.file.name} 上传失败`);
				}
			},
		};
		const propsDetail = {
			action:baseUrl+'/lot-file/file/uploadFile',
			// data:paramDataFile, 
			name: 'file',
			// accept:'.pdf',
			showUploadList:false,
			headers: {
				Token: localStorage.getItem('token'),
			},
			multiple:true,
			onChange(info) {
				if (info.file.status !== 'uploading') {
					// console.log(info.file, info.fileList);
				}
				if (info.file.status === 'done') {
					console.log(info.file.response.data)
					
					const fileList = that.state.fileList
					fileList.push(info.file.response.data)
					console.log(fileList)
					// }
					that.handleUpload(fileList)
					message.success(`${info.file.name} 上传成功`);
				} else if (info.file.status === 'error') {
					message.error(`${info.file.name} 上传失败`);
				}
			},
		};

		const modalProps = {
			title:"选择设备",
			visible:visibleEqu,
			width : '780px',
			onCancel() {
			  p.closeModal();
			},
			okText:'保存',
			cancelText:'取消',
			onOk(){
			  p.modalSubmit();
			}
		  };
		return (
			<div className="shadow-radius">
				<Card>
					<BasicForm formList={this.formList()} filterSubmit={this.filterSubmit} labelSpan={8} wrapperSpan={12} onRef={ref => (this.child = ref)} />
				</Card>

				<Tabs
					tabBarExtraContent={
						<div className="buttonList">
							<Button icon="plus" onClick={() => this.handleModal(0, {})} type="primary">{' '}添加报修</Button>
							{/* <Button icon="delete" onClick={() => this.handleModal(0, {})} type="primary">{' '}删除报修</Button> */}
							<BasicConfirm title="确认删除?" api={1} icon="delete" button={true} buttonName="删除报修" data={selectedData} handleConfirm={this.handleConfirm} />
							<FileDown fileName="故障报修清单" buttonName="导出" method="post" apiPath={euqApplicationName + "/equipmentRepairFault/exportEquipmentRepairFaultListExcel"} data={{...this.state.formValues,ids:selectedKeys,typeIds:[0,1],userId:localStorage.getItem('userId'),statusIds:this.state.formValues.statusIds ? [this.state.formValues.statusIds] : []}} />
							{/* <Button icon="delete" onClick={() => this.handlePrinting(0, {})} type="primary">{' '}打印</Button> */}
						</div>
					}
				>
					<TabPane tab="故障报修" key="1">
						<Table columns={columns} rowSelection={rowSelection} rowKey={(record, index) => record.id} dataSource={this.state.dataSource} pagination={false} loading={loading} scroll={{ y: 450 ,x:1500}}  onRowClick={(record)=>{this.onRowClick(record)}}/>
						<Paging total={total} formValues={formValues} fetch={pager => this.fetch(pager)} />
					</TabPane>
				</Tabs>
				<Tabs defaultActiveKey="1">
					<TabPane tab="操作记录" key="1">
						<Table columns={columns1} loading={loading_cz} rowKey={(record, index) => record.id} dataSource={FaultOperationRecordList} pagination={false} scroll={{ y: 250 }} />
						{/* <Paging total={total} formValues={formValues} fetch={pager => this.fetch(pager)} /> */}
					</TabPane>
					{/* <TabPane tab="存档文档" key="2">
						<Table columns={columns1} rowSelection={rowSelection} rowKey={(record, index) => index} dataSource={dataSource1} pagination={false} loading={loading} scroll={{ y: 250 }} />
						<Paging total={total} formValues={formValues} fetch={pager => this.fetch(pager)} />
					</TabPane> */}
					<TabPane tab="故障图片" key="2">
						<Upload 
							{...propsDetail}
								// accept=".pdf"
								// ustomRequest={this.customRequest}
							>
							<Button type="primary" style={{marginRight:20,display:this.state.selectedKeys.length===1 ? 'inline-block' : 'none'}}>
								<Icon type="upload" /> 上传图片
							</Button>
							
						</Upload>
						<span style={{marginBottom:20,display:this.state.selectedKeys.length===1 ? 'inline-block' : 'none'}}>
							<BasicConfirm title="确认删除?" api={1} icon="delete" button={true} buttonName="删除图片" data={ChoosePicList} handleConfirm={this.handleDelete} />
						</span>
						<Checkbox.Group style={{ width: '100%' ,marginLeft:15,display:this.state.selectedKeys.length===1 ? 'inline-block' : 'none'}} onChange={this.onChange} defaultValue={ChoosePicList}>
							<Row gutter={20} style={{width:1200}}>
								{this.state.pictureIdList && this.state.pictureIdList.length>0 ? this.state.pictureIdList.map((ii,index)=>{
									return  <Col span={4}>
												<Checkbox value={pictureIds[index]}><Zmage src={ii} style={{width:150,height:120,}}/></Checkbox>
											</Col>
								}) : ' 暂无图片'}
							</Row>
						</Checkbox.Group>

					</TabPane>
				</Tabs>


				<Modal {...modalProps}>
					<Form  {... {labelCol: {xs: { span: 30 },sm: { span:6 },},wrapperCol: {xs: {span: 24},sm: {span: 14}}}}>
					<Row gutter={24}>
						<Col span={10}>
								<Form.Item label="设备类别">
									{getFieldDecorator('equTypeId')(
										<TreeSelect onChange={this.onTreeChange} placeholder={'请选择设备类别'} showCheckedStrategy="SHOW_PARENT" treeCheckable={false}  allowClear>
										{this.renderTreeNodes(EquTypePageList, 'name', 'id')}
										</TreeSelect>)}
								</Form.Item>
						</Col>
						<Col span={10}>
								<Form.Item label="所在部门">
									{getFieldDecorator('depId',)(
										<Select allowClear placeholder='请输入所在部门'>
												{DepartmentList.map(item=><Option value={item.id}>{item.name}</Option>)}
										</Select>)}
								</Form.Item>
						</Col>
						<Col span={4}>
							<Button type="primary" onClick={()=>{this.TableSearch()}}>查询</Button>
						</Col>
					</Row>
					</Form>	
						<Table columns={column} dataSource={p.state.tableData} pagination={false} loading={loadingTable}  rowSelection={rowSelectionTable} rowKey={(record, index) => record.id} childrenColumnName={''} />
						<Paging total={totalTable} formValues={formValuesTable} fetch={pager => this.fetchTable(pager)} />
				</Modal>
				{/* <BasicDrawers {...drawerProps} /> */}

				<Drawer {...drawerProps} >
				<Form {...{ labelCol: { xs: { span: 6 }, sm: { span: 8},},	wrapperCol: { xs: { span: 12 }, sm: { span: 16 }, }}}>
					<h2>设备信息</h2>
					<Row gutter={24}>
						<Col span={12}>

						<Form.Item label="设备编号">
						{getFieldDecorator('equCode', {
							// rules: [{	required: true,	message: '请填写承运单号'}]
						})(<Input allowClear placeholder='请输入设备编号' disabled={true}/>)}
					</Form.Item>
						</Col>
						<Col span={12}>
						<Form.Item label="设备名称">
						{getFieldDecorator('equName',{	rules: [{	required:this.state.handleType!==2 ? true : false,	message: '请输入设备名称'}]})(
							<Input allowClear placeholder='请输入设备名称' disabled={true}/>)}
					</Form.Item>
						</Col>
					</Row>
					<Row gutter={24}>
						<Col span={12}>
							<Form.Item label="设备类别">
								{getFieldDecorator('equType')(
								// <TreeSelect onChange={this.onTreeChange} placeholder={'请选择设备类别'} showCheckedStrategy="SHOW_PARENT" treeCheckable={false}  allowClear>
								// {this.renderTreeNodes(EquTypePageList, 'name', 'id')}
								// </TreeSelect>)}
								<Input allowClear placeholder='请输入设备类别' disabled={true}/>)}
							</Form.Item>
							</Col>
							<Col span={12}>
							<Form.Item label="规格型号">
								{getFieldDecorator('equSpecsModel',)(
								<Input allowClear placeholder='请输入规格型号' disabled={true}/>)}
							</Form.Item>
						</Col>
					</Row>
					<Row gutter={24}>
						<Col span={12}>
					<Form.Item label="所在部门">
						{getFieldDecorator('deptId',)(
						// <Select allowClear placeholder='请输入所在部门'>
						// 		{DepartmentList.map(item=><Option value={item.id}>{item.name}</Option>)}
						// </Select>)}
								<Input allowClear placeholder='请输入所在部门' disabled={true}/>)}
					</Form.Item>
					</Col>
						<Col span={12}>
					<Form.Item label="设备位置">
						{getFieldDecorator('equLocation')(<Input allowClear placeholder='请输入设备位置' disabled={true}/>)}
					</Form.Item>
					</Col>
					</Row>
					<Row style={{textAlign:'center'}}><Button type="primary" onClick={()=>{this.chooseEqu()}} style={{display:(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0 ) && this.state.handleType !== 2 ? 'inline-block' : 'none'}}>选择设备</Button></Row>
					<h2>处理情况</h2>
					<Row gutter={24}>
						<Col span={12}>
						<Form.Item label="发生时间">
							{getFieldDecorator('dateSec_occurrenceTime',{	rules: [{	required: this.state.handleType!==2 ? true : false,	message: '请填写发生时间'}]})(<DatePicker style={{width:'210px'}} allowClear placeholder='请输入发生时间' disabled={(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) && this.state.handleType !== 2 ? false : true} disabledDate={this.disabledDate}/>)}
						</Form.Item></Col>
						<Col span={12}>
						<Form.Item label="操作人" >
							{getFieldDecorator('operator',{	rules: [{	required: true,	message: '请填写操作人'}] })(
							// <Input allowClear placeholder='请输入操作人' disabled={(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) && this.state.handleType !== 2 ? false : true}/>,initialValue:Number(localStorage.getItem('userId'))}
							// <Select allowClear placeholder='请输入操作人' disabled={true}>
							// {UserList.map(item=><Option value={item.userName}>{item.userName}</Option>)}
							// </Select>
							<Input disabled={true} />
					)}
						</Form.Item></Col>
					</Row>
					<Row gutter={24}>
						<Col span={12}>
							<Form.Item label="操作者电话">
								{getFieldDecorator('operatorTel')(<Input allowClear placeholder='请输入操作者电话' disabled={true}/>)}
							</Form.Item>
						</Col>
						<Col span={12}>
							<Form.Item label="故障等级">
							{getFieldDecorator('faultLevel')(<Select allowClear placeholder='请输入故障等级' disabled={(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) && this.state.handleType !== 2 ? false : true}>
									{gzdj.map(item=><Option value={item.id}>{item.configValue}</Option>)}
								</Select>)}
							</Form.Item>
						</Col>
					</Row>
					<Row gutter={24}>
						<Col span={12}>
							<Form.Item label="故障类别">
							{getFieldDecorator('faultTypeId')(<TreeSelect onChange={this.onTreeChange} placeholder={'请选择故障类别'} showCheckedStrategy="SHOW_PARENT" treeCheckable={false}  allowClear disabled={(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) && this.state.handleType !== 2 ? false : true}>
								{this.renderTreeNodes(gzlb, 'name', 'id')}
								</TreeSelect>)}
							</Form.Item>
						</Col>
						<Col span={12}>
							<Form.Item label="维修组">
							{getFieldDecorator('maintainTeamId')(<Select allowClear placeholder='请输入维修组' disabled={(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) && this.state.handleType !== 2 ? false : true}>
									{wxz.map(item=><Option value={item.id}>{item.name}</Option>)}
							</Select>)}
							</Form.Item>
						</Col>
					</Row>
					<Row gutter={24}>
						<Col span={12}>
							<Form.Item label="紧急程度">
							{getFieldDecorator('urgency')(<Select allowClear placeholder='请输入紧急程度' disabled={(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) && this.state.handleType !== 2 ? false : true}>
									{jjcd.map(item=><Option value={item.id}>{item.configValue}</Option>)}
							</Select>)}
							</Form.Item>
						</Col>
						<Col span={12}>
							<Form.Item label="是否停机">
							{getFieldDecorator('isStop', { valuePropName: 'checked' })(<Switch disabled={(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) && this.state.handleType !== 2 ? false : true}/>)}
							</Form.Item>
						</Col>
					</Row>
					
					<Row gutter={24}>
						<Col span={12}>
							<Form.Item label="故障描述">
								{getFieldDecorator('faultDescription',{	rules: [{	required: this.state.handleType!==2 ? true : false,	message: '请填写故障描述'}]})(<TextArea disabled={(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) && this.state.handleType !== 2 ? false : true} allowClear placeholder='请输入故障描述'/>)}
							</Form.Item>
						</Col>
						<Col span={12} style={{display:(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0 ) && this.state.handleType !== 2 ? 'inline-block' : 'none',marginTop:15}}><Upload 
								{...props}
									// accept=".pdf"
									// ustomRequest={this.customRequest}
								>
								<Button type="primary">
									<Icon type="upload" /> 上传图片
								</Button>
								
							</Upload>
							{
								this.state.fileList.map((e,i)=>{
									return <div style={{display:'flex',width:'75%',textAlign:'justify'}} key={i}>
										<div>{e.fileName}&nbsp;&nbsp;&nbsp;<Icon type="delete" onClick = {()=>this.removeFile(i)}/></div>
									</div>
								})
							}
						</Col>
					</Row>
					{/* <Row style={{textAlign:'center'}}><Col style={{display:(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0 ) && this.state.handleType !== 2 ? 'inline-block' : 'none'}}><Upload {...props}><Button type='primary'><Icon type="upload" />上传图片</Button></Upload></Col></Row> */}
					<div style={{display:this.state.handleType===2 ? 'block' : 'none'}}>
					<h2>审核情况</h2>
					<Row gutter={24}>
						<Col span={12}>
						<Form.Item label="审核人">
							{getFieldDecorator('operateId')(<Input allowClear placeholder='请填写审核人' disabled/>)}
						</Form.Item></Col>
						<Col span={12}>
						<Form.Item label="审核意见" >
							{getFieldDecorator('checkReview',{initialValue:this.state.value})(<Radio.Group onChange={this.onChangeRadio}>
							<Radio value={1}>立即维修</Radio>
							<Radio value={2}>列入计划</Radio>
							<Radio value={3}>驳回</Radio>
							</Radio.Group>)}
						</Form.Item></Col>
					</Row>
					<Row gutter={24}>
						<Col span={this.state.value===1 ? 12 : 8} style={{display:this.state.value===1 || this.state.value===2 ? 'inline-block' : 'none'}}>
						<Form.Item label="维修组">
							{getFieldDecorator('maintainTeamId')(<Select allowClear placeholder='请输入维修组'onChange={this.teamChange}>
									{wxz.map(item=><Option value={item.id}>{item.name}</Option>)}
							</Select>)}
						</Form.Item></Col>
						<Col span={this.state.value===1 ? 12 : 8}  style={{display:this.state.value===1 || this.state.value===2 ? 'inline-block' : 'none'}}>
						<Form.Item label="维修人员">
							{getFieldDecorator('repairWorker',)(<Select allowClear placeholder='请输入维修人员' mode="multiple">
								{UserList.map(item=><Option value={item.userId}>{item.userName}</Option>)}
							</Select>)}
						</Form.Item></Col>
						<Col  span={this.state.value===1 ? 12 : 8}  style={{display:this.state.value===2 ? 'inline-block' : 'none'}}>
						<Form.Item label="计划维修时间">
							{getFieldDecorator('planExeTime',{	rules: [{	required: this.state.value === 2 ? true : false,	message: '请填写计划维修时间'}]})(<DatePicker allowClear placeholder='请输入发生时间'/>)}
						</Form.Item></Col>
					</Row>
					<Row gutter={24}>
						<Col span={12}>
							<Form.Item label="处理意见">
								{getFieldDecorator('dealReview')(<TextArea allowClear placeholder='请输入处理意见'/>)}
							</Form.Item>
						</Col>
					</Row>
					</div>

					<Row style={{textAlign:'center', marginTop:25, display:(this.state.handleType !== 2 && (this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) )|| (this.state.handleType === 2 && (this.state.value === 1 || this.state.value === 2) ) ? 'block' : 'none'}}>
						<Col span={12}>
							<Form.Item label="下一审核人" style={{fontWeight:700}}>
							{/* disabled={(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0) || this.state.handleType === 2 ? false : true}  */}
								{getFieldDecorator('lastOperate')(<Select allowClear placeholder='请输入下一审核人'>
										{roleList.map(item=><Option value={item.userId}>{item.userName}</Option>)}
								</Select>)}
							</Form.Item>
						</Col>
					</Row>
					
					 
					
				</Form>
					<div
					style={{
									position: 'absolute',
					right: 0,
					bottom: 0,
					width: '100%',
					borderTop: '1px solid #e9e9e9',
					padding: '10px 16px',
					background: '#fff',
					textAlign: 'right',
					}}
				>
					<Button style={{  marginRight: 8, }}onClick={this.onClose}>取消</Button>
					<Button onClick={this.lastOperateIsChoose} type="primary" style={{display:(this.state.status === 1 || this.state.status === 2  || this.state.handleType === 0 ) || this.state.handleType === 2 ? 'inline-block' : 'none'}}>保存</Button>
				</div>
				</Drawer>

				
				
			</div>
		);
	}
}
export default Form.create()(App);
